//
//  DYZNetworkManager.h
//  DYZCars
//
//  Created by MF on 16/8/18.
//  Copyright © 2016年 MF. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>



typedef void (^successBlock)(id data);
typedef void (^failedBlock)(NSError *error);
typedef void (^errorBlock)(NSString *message);

@interface DYZNetworkManager : AFHTTPSessionManager
/**
 *  单例接口
 *
 *  @return <#return value description#>
 */
+ (instancetype)sharedManager;

- (void)loadDataWithURLString:(NSString *)urlString parameters:(NSDictionary *)parameters completion:(void(^)(id data, NSError *error))completion;

// GET请求方法
+ (void)getUrlString:(NSString *)url
           withParam:(NSDictionary *)param
    withSuccessBlock:(successBlock)success
     withFailedBlock:(failedBlock)failed
      withErrorBlock:(errorBlock)error;

// POST请求方法
+ (void)postUrlString:(NSString *)url
            withParam:(NSDictionary *)param
     withSuccessBlock:(successBlock)success
      withFailedBlock:(failedBlock)failed
       withErrorBlock:(errorBlock)error;

@end
